package com.yiji.fintech.musfinance.facadeimpl.withdraw;

import com.acooly.core.utils.enums.ResultStatus;
import com.alibaba.dubbo.config.annotation.Service;
import com.yiji.fintech.musfinance.center.base.order.OrderFacade;
import com.yiji.fintech.musfinance.center.withdraw.api.WithdrawFacade;
import com.yiji.fintech.musfinance.center.withdraw.result.WithdrawResult;
import com.yiji.fintech.musfinance.common.dispatcher.Dispatcher;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 提现
 * Created by ouwen@yiji.com} on 2017/9/26.
 */
@Service(version = "1.0")
public class WithdrawFacadeImpl implements WithdrawFacade {
    @Autowired
    private Dispatcher dispatcher;

    @Override
    public WithdrawResult withdraw(OrderFacade withdrawOrder) {
        WithdrawResult result = new WithdrawResult();
        result.setStatus(ResultStatus.processing);
        result.setCode(ResultStatus.processing.code());
        result.setDetail(ResultStatus.processing.getMessage());
        dispatcher.doExcute(withdrawOrder,result);
        return result;
    }
}
